const UserModel = require('../database/model/User');
const AttendanceModel = require('../database/model/Attendance');

class UserController {
  static async createUser(ctx) {
    console.log(ctx.request.body);
    await UserModel.createUser(ctx.request.body).then(res => {
      console.log(res);
    })
    ctx.response.status = 200;
    ctx.body = {};
  }

  static async getAllUser(ctx) {
    await UserModel.getAllUser().then(res => {
      ctx.response.status = 200;
      ctx.body = res;
    });
  }

  static async attendance(ctx) {
    await AttendanceModel.attendance(ctx.request.body).then(res => {
      ctx.response.status = 200;
      ctx.body = res;
    });
  }

  static async getAllAttendance(ctx) {
    await AttendanceModel.getAllAttendance().then(res => {
      ctx.response.status = 200;
      ctx.body = res;
    });
  }
}

module.exports = UserController;